<%@page import="board.BoardVo"%>
<%@page import="java.util.Vector"%>
<%@page import="board.Board"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("utf-8"); %>


<jsp:useBean id="BoardVo" class="board.BoardVo"/>
<jsp:setProperty property="*" name="BoardVo"/>
<%
String part = "board";
BoardVo.setPart(part);

Board board = new Board();
board.setVo(BoardVo);
board.setNowPage(BoardVo.getNowPage());


Vector<BoardVo> v = board.list();

out.print("var jsonArray=[");
for(int i=0; i<v.size(); i++){
	BoardVo vo = v.get(i);
	
	out.print("{mid: \'" + vo.getMid() +"\',");
	out.print(" subject: \'" + vo.getSubject() + "\',");
	out.print(" mdate: \'" + vo.getMdate() + "\',");
	out.print(" hit: \'" + vo.getHit() + "\'}");
	if(i<v.size()-1) out.print(",");
}
out.print("];");

 out.print("var pageInfo={");
	
	out.print(" totPage: \'" + board.getTotPage() + "\',");  // {key: value} 형태로 넘어감
	out.print(" startPage: \'" + board.getStartPage() + "\',");
	out.print(" endPage: \'" + board.getEndPage() + "\',");
	out.print(" nowPage: \'" + board.getNowPage() + "\',");
 	out.print(" startNo: \'" + board.getStartPage() + "\',");
	out.print(" endNo: \'" + board.getEndNo() + "\',");
	out.print(" nowBlock: \'" + board.getNowBlock() + "\',");
	out.print(" totBlock: \'" + board.getTotBlock() + "\',");
	out.print(" blockSize: \'" + board.getBlockSize() + "\',");
	out.print(" totSize: \'" + board.getTotSize() + "\'}");
%>
